set -ex
export NWCHEM_TOP=/global/homes/m/mc29/nwchem-6.3_opt/
export NWCHEM_TARGET=LINUX64
export NWCHEM_MODULES=all
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export USE_SCALAPACK=y
export USE_64TO32=y
export LIBMPI=" "
module swap PrgEnv-intel PrgEnv-gnu
module load craype-hugepages64M
#module load gcc/4.7.2  
export ARMCI_NETWORK=DMAPP
export USE_SCALAPACK=y
export SCALAPACK=-lsci_gnu
export SCALAPACK_LIB=-lsci_gnu
export BLASOPT=-lsci_gnu
export BLAS_LIB=-lsci_gnu
export LAPACK_LIB=-lsci_gnu
export USE_64TO32=y
export CFLAGS_FORGA="-g -fno-omit-frame-pointer"
export FFLAGS_FORGA="-g -fno-omit-frame-pointer"
#make realclean
#make nwchem_config
#make 64_to_32
#make FC=/global/homes/m/mc29/myCompilerWrapper/myFC.sh CC=/global/homes/m/mc29/myCompilerWrappers/myCC.sh   >& make.log
#make FC=ftn  >& make.log
ftn -fdefault-integer-8 -Wextra -Wuninitialized  -g -O   -I.  -I/global/homes/m/mc29/nwchem-6.3_opt//src/include -I/global/homes/m/mc29/nwchem-6.3_opt//src/tools/install/include -DCRAYXT -DEAFHACK -DNOFSCHECK -DEXT_INT -DLINUX -DLINUX64 -DCHKUNDFLW -DGCC4 -DGCC46 -DSCALAPACK -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/global/homes/m/mc29/nwchem-6.3_opt/'" -DNWCHEM_BRANCH="'6.3'"  -c -o nwchem.o nwchem.F

ftn -fdefault-integer-8 -Wextra -Wuninitialized  -g -O   -I.  -I/global/homes/m/mc29/nwchem-6.3_opt//src/include -I/global/homes/m/mc29/nwchem-6.3_opt//src/tools/install/include -DCRAYXT -DEAFHACK -DNOFSCHECK -DEXT_INT -DLINUX -DLINUX64 -DCHKUNDFLW -DGCC4 -DGCC46 -DSCALAPACK -DPARALLEL_DIAG -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" -DCOMPILATION_DIR="'/global/homes/m/mc29/nwchem-6.3_opt/'" -DNWCHEM_BRANCH="'6.3'"  -c -o stubs.o stubs.F

#ftn   -L/global/homes/m/mc29/nwchem-6.3_opt//lib/LINUX64 -L/global/homes/m/mc29/nwchem-6.3_opt//src/tools/install/lib  -o /global/homes/m/mc29/nwchem-6.3_opt//bin/LINUX64/nwchem_orig nwchem.o stubs.o -lnwctask -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil -lsci_gnu   -l64to32 -lsci_gnu  

#ftn   -L/global/homes/m/mc29/nwchem-6.3_opt//lib/LINUX64 -L/global/homes/m/mc29/nwchem-6.3_opt//src/tools/install/lib  -o /global/homes/m/mc29/nwchem-6.3_opt//bin/LINUX64/nwchem nwchem.o stubs.o -lnwctask -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil -lsci_gnu   -l64to32 -lsci_gnu    -Wl,--wrap=dmapp_init -Wl,--wrap=dmapp_init_ext -Wl,--wrap=dmapp_finalize -Wl,--wrap=dmapp_set_rma_attrs -Wl,--wrap=dmapp_set_rma_attrs_ext -Wl,--wrap=dmapp_put_nb -Wl,--wrap=dmapp_put_nbi -Wl,--wrap=dmapp_put -Wl,--wrap=dmapp_put_flag_nb -Wl,--wrap=dmapp_put_flag_nbi -Wl,--wrap=dmapp_put_flag -Wl,--wrap=dmapp_get_nb -Wl,--wrap=dmapp_get_nbi -Wl,--wrap=dmapp_get -Wl,--wrap=dmapp_get_flag_nbi -Wl,--wrap=dmapp_iput_nb -Wl,--wrap=dmapp_iput_nbi -Wl,--wrap=dmapp_iput -Wl,--wrap=dmapp_iget_nb -Wl,--wrap=dmapp_iget_nbi -Wl,--wrap=dmapp_iget -Wl,--wrap=dmapp_ixput_nb -Wl,--wrap=dmapp_ixput_nbi -Wl,--wrap=dmapp_ixput -Wl,--wrap=dmapp_ixget_nb -Wl,--wrap=dmapp_ixget_nbi -Wl,--wrap=dmapp_ixget -Wl,--wrap=dmapp_put_ixpe_nb -Wl,--wrap=dmapp_put_ixpe_nbi -Wl,--wrap=dmapp_put_ixpe -Wl,--wrap=dmapp_scatter_ixpe_nb -Wl,--wrap=dmapp_scatter_ixpe_nbi -Wl,--wrap=dmapp_scatter_ixpe -Wl,--wrap=dmapp_gather_ixpe_nb -Wl,--wrap=dmapp_gather_ixpe_nbi -Wl,--wrap=dmapp_gather_ixpe -Wl,--wrap=dmapp_aadd_qw_nb -Wl,--wrap=dmapp_aadd_qw_nbi -Wl,--wrap=dmapp_aadd_qw -Wl,--wrap=dmapp_aand_qw_nb -Wl,--wrap=dmapp_aand_qw_nbi -Wl,--wrap=dmapp_aand_qw -Wl,--wrap=dmapp_aor_qw_nb -Wl,--wrap=dmapp_aor_qw_nbi -Wl,--wrap=dmapp_aor_qw -Wl,--wrap=dmapp_axor_qw_nb -Wl,--wrap=dmapp_axor_qw_nbi -Wl,--wrap=dmapp_axor_qw -Wl,--wrap=dmapp_afadd_qw_nb -Wl,--wrap=dmapp_afadd_qw_nbi -Wl,--wrap=dmapp_afadd_qw -Wl,--wrap=dmapp_afand_qw_nb -Wl,--wrap=dmapp_afand_qw_nbi -Wl,--wrap=dmapp_afand_qw -Wl,--wrap=dmapp_afxor_qw_nb -Wl,--wrap=dmapp_afxor_qw_nbi -Wl,--wrap=dmapp_afxor_qw -Wl,--wrap=dmapp_afor_qw_nb -Wl,--wrap=dmapp_afor_qw_nbi -Wl,--wrap=dmapp_afor_qw -Wl,--wrap=dmapp_afax_qw_nb -Wl,--wrap=dmapp_afax_qw_nbi -Wl,--wrap=dmapp_afax_qw -Wl,--wrap=dmapp_acswap_qw_nb -Wl,--wrap=dmapp_acswap_qw_nbi -Wl,--wrap=dmapp_acswap_qw -Wl,--wrap=dmapp_lock_acquire -Wl,--wrap=dmapp_lock_try -Wl,--wrap=dmapp_lock_release -Wl,--wrap=dmapp_lock_release_addr -Wl,--wrap=dmapp_sheap_stats -Wl,--wrap=dmapp_mem_register -Wl,--wrap=dmapp_mem_unregister -Wl,--wrap=dmapp_segdesc_compare -Wl,--wrap=dmapp_mem_reserve -Wl,--wrap=dmapp_mem_update -Wl,--wrap=dmapp_checkpoint -Wl,--wrap=dmapp_restart -Wl,--wrap=dmapp_progress -Wl,--wrap=dmapp_c_pset_create -Wl,--wrap=dmapp_c_pset_export -Wl,--wrap=dmapp_c_pset_destroy -Wl,--wrap=dmapp_c_barrier_join -Wl,--wrap=dmapp_c_greduce_start -Wl,--wrap=dmapp_c_greduce_nelems_max -Wl,--wrap=dmapp_c_pset_test -Wl,--wrap=dmapp_c_pset_wait -Wl,--wrap=dmapp_c_pset_cancel_op -Wl,--wrap=dmapp_amo_put -Wl,--wrap=dmapp_amo_put_nb -Wl,--wrap=dmapp_amo_put_nbi -Wl,--wrap=dmapp_amo_get -Wl,--wrap=dmapp_amo_get_nb -Wl,--wrap=dmapp_amo_get_nbi -Wl,--wrap=dmapp_amo_flush -Wl,--wrap=dmapp_queue_put  -Wl,--wrap=MPI_Barrier -Wl,--wrap=MPI_Bcast -Wl,--wrap=MPI_Allreduce -Wl,--wrap=MPI_Allgather /global/homes/m/mc29/experiments/dmapp_overrides/barrier_deletion.o  /global/homes/m/mc29/experiments/dmapp_overrides/dmapp_wrapped.o -L/global/u2/m/mc29/software/libunwind-1.1-install/lib/ -lunwind -lstdc++ 

ftn   -L/global/homes/m/mc29/nwchem-6.3_opt//lib/LINUX64 -L/global/homes/m/mc29/nwchem-6.3_opt//src/tools/install/lib  -o /global/homes/m/mc29/nwchem-6.3_opt//bin/LINUX64/nwchem_bd nwchem.o stubs.o -lnwctask -lccsd -lmcscf -lselci -lmp2 -lmoints -lstepper -ldriver -loptim -lnwdft -lgradients -lcphf -lesp -lddscf -ldangchang -lguess -lhessian -lvib -lnwcutil -lrimp2 -lproperty -lnwints -lprepar -lnwmd -lnwpw -lofpw -lpaw -lpspw -lband -lnwpwlib -lnwxc -lcafe -lspace -lanalyze -lqhop -lpfft -ldplot -ldrdy -lvscf -lqmmm -lqmd -letrans -lpspw -ltce -lbq -lcons -lperfm -ldntmc -lccca -lnwcutil -lga -larmci -lpeigs -lperfm -lcons -lbq -lnwcutil -lsci_gnu   -l64to32 -lsci_gnu    -Wl,--wrap=dmapp_init -Wl,--wrap=dmapp_init_ext -Wl,--wrap=dmapp_finalize -Wl,--wrap=dmapp_get_rma_attrs_ext -Wl,--wrap=dmapp_set_rma_attrs -Wl,--wrap=dmapp_set_rma_attrs_ext -Wl,--wrap=dmapp_put_nb -Wl,--wrap=dmapp_put_nbi -Wl,--wrap=dmapp_put -Wl,--wrap=dmapp_put_flag_nb -Wl,--wrap=dmapp_put_flag_nbi -Wl,--wrap=dmapp_put_flag -Wl,--wrap=dmapp_get_nb -Wl,--wrap=dmapp_get_nbi -Wl,--wrap=dmapp_get -Wl,--wrap=dmapp_get_flag_nbi -Wl,--wrap=dmapp_iput_nb -Wl,--wrap=dmapp_iput_nbi -Wl,--wrap=dmapp_iput -Wl,--wrap=dmapp_iget_nb -Wl,--wrap=dmapp_iget_nbi -Wl,--wrap=dmapp_iget -Wl,--wrap=dmapp_ixput_nb -Wl,--wrap=dmapp_ixput_nbi -Wl,--wrap=dmapp_ixput -Wl,--wrap=dmapp_ixget_nb -Wl,--wrap=dmapp_ixget_nbi -Wl,--wrap=dmapp_ixget -Wl,--wrap=dmapp_put_ixpe_nb -Wl,--wrap=dmapp_put_ixpe_nbi -Wl,--wrap=dmapp_put_ixpe -Wl,--wrap=dmapp_scatter_ixpe_nb -Wl,--wrap=dmapp_scatter_ixpe_nbi -Wl,--wrap=dmapp_scatter_ixpe -Wl,--wrap=dmapp_gather_ixpe_nb -Wl,--wrap=dmapp_gather_ixpe_nbi -Wl,--wrap=dmapp_gather_ixpe -Wl,--wrap=dmapp_aadd_qw_nb -Wl,--wrap=dmapp_aadd_qw_nbi -Wl,--wrap=dmapp_aadd_qw -Wl,--wrap=dmapp_aand_qw_nb -Wl,--wrap=dmapp_aand_qw_nbi -Wl,--wrap=dmapp_aand_qw -Wl,--wrap=dmapp_aor_qw_nb -Wl,--wrap=dmapp_aor_qw_nbi -Wl,--wrap=dmapp_aor_qw -Wl,--wrap=dmapp_axor_qw_nb -Wl,--wrap=dmapp_axor_qw_nbi -Wl,--wrap=dmapp_axor_qw -Wl,--wrap=dmapp_afadd_qw_nb -Wl,--wrap=dmapp_afadd_qw_nbi -Wl,--wrap=dmapp_afadd_qw -Wl,--wrap=dmapp_afand_qw_nb -Wl,--wrap=dmapp_afand_qw_nbi -Wl,--wrap=dmapp_afand_qw -Wl,--wrap=dmapp_afxor_qw_nb -Wl,--wrap=dmapp_afxor_qw_nbi -Wl,--wrap=dmapp_afxor_qw -Wl,--wrap=dmapp_afor_qw_nb -Wl,--wrap=dmapp_afor_qw_nbi -Wl,--wrap=dmapp_afor_qw -Wl,--wrap=dmapp_afax_qw_nb -Wl,--wrap=dmapp_afax_qw_nbi -Wl,--wrap=dmapp_afax_qw -Wl,--wrap=dmapp_acswap_qw_nb -Wl,--wrap=dmapp_acswap_qw_nbi -Wl,--wrap=dmapp_acswap_qw -Wl,--wrap=dmapp_lock_acquire -Wl,--wrap=dmapp_lock_try -Wl,--wrap=dmapp_lock_release -Wl,--wrap=dmapp_lock_release_addr -Wl,--wrap=dmapp_syncid_test -Wl,--wrap=dmapp_sheap_stats -Wl,--wrap=dmapp_mem_register -Wl,--wrap=dmapp_mem_unregister -Wl,--wrap=dmapp_segdesc_compare -Wl,--wrap=dmapp_mem_reserve -Wl,--wrap=dmapp_mem_update -Wl,--wrap=dmapp_checkpoint -Wl,--wrap=dmapp_restart -Wl,--wrap=dmapp_progress -Wl,--wrap=dmapp_c_pset_create -Wl,--wrap=dmapp_c_pset_export -Wl,--wrap=dmapp_c_pset_destroy -Wl,--wrap=dmapp_c_barrier_join -Wl,--wrap=dmapp_c_greduce_start -Wl,--wrap=dmapp_c_greduce_nelems_max -Wl,--wrap=dmapp_c_pset_test -Wl,--wrap=dmapp_c_pset_wait -Wl,--wrap=dmapp_c_pset_cancel_op -Wl,--wrap=dmapp_amo_put -Wl,--wrap=dmapp_amo_put_nb -Wl,--wrap=dmapp_amo_put_nbi -Wl,--wrap=dmapp_amo_get -Wl,--wrap=dmapp_amo_get_nb -Wl,--wrap=dmapp_amo_get_nbi -Wl,--wrap=dmapp_amo_flush -Wl,--wrap=dmapp_queue_put  -Wl,--wrap=MPI_Init -Wl,--wrap=MPI_Finalize  -Wl,--wrap=MPI_Barrier -Wl,--wrap=MPI_Bcast -Wl,--wrap=MPI_Allreduce -Wl,--wrap=MPI_Allgather /global/homes/m/mc29/experiments/dmapp_overrides/barrier_deletion.o  /global/homes/m/mc29/experiments/dmapp_overrides/dmapp_wrapped.o -L/global/u2/m/mc29/software/libunwind-1.1-install/lib/ -lunwind -lstdc++ 

